<?
require '../home/config.php';

$client_id = 'sudo';
$client_key = '25f229afe78d7423f364cca3af1d9ca4';

$access_code = $_REQUEST['access_code'];

$token_url = 'http://localhost:5011/oauth/accessCode/'.$access_code.'';
$ch = curl_init($token_url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "{$client_id}:{$client_key}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$respone_data = curl_exec($ch);
//dump($respone_data);die;
$info = json_decode(base64_decode($respone_data),true);
dump($info);

?>